const crypto = require("crypto");

const source = 'hellolaowang' ;

let name = 'sha512' ;
let salt = 'yuge' ;
let hmac = crypto.createHmac( name , salt );

hmac.update( source ); // 加盐加密

let result = hmac.digest( 'hex' ); // 获得结果
console.log( result );
console.log( result.length );